{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<!-- <link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/user_glb.css?version={$version}"> -->

<style type="text/css">
    /*-----有无海外投资资格------*/
   .overseas{
   	width:100%;
   	height:2.45rem;
   	background:#fff;
   	color:#666;
   	font-size:0.8rem;
   	box-sizing:border-box;
   	padding:0 0.8rem;
   	line-height:2.45rem;
   }
   .overseas li{
   	display:flex;
   	height:2.45rem;
   	align-items:center;
   }
   .overseas li i{
   	margin-right:0.25rem;
   }
   #form1{
    margin-bottom: 2.45rem;
    margin-top: 2.2rem;
   }
   .submit_btn{
   		position:static;
   }
</style>
{/block}
{block name="content"}
{include file="../common_header.html"}
<form id='form1'>
<h6 class="bei">个人基本信息</h6>
<ul class="visit_from" style="margin-top:0;">
    <li class="clearfix">
        <label for="name_ren" class="fl">真实姓名</label>
        <input type="text" id="name_ren" name="realname" value="{$user.realname}" placeholder="请输入真实姓名">
    </li>
    <li class="clearfix">
        <label for="tell" class="fl">联系电话</label>
        <input type="number" id="tell" name="contact_phone" value="" placeholder="请输入联系电话">
    </li>
    <li class="clearfix">
        <label for="organize" class="fl">所在机构</label>
        <input type="text" id="organize" name="company_address" value="" placeholder="请输入所在机构">
    </li>
    <li class="clearfix">
        <label for="job" class="fl">职位</label>
        <input type="text" id="job" name="position" value="" placeholder="请输入职位">
    </li>
    <li class="clearfix">
        <label class="fl">所在省份</label>
        <select id="province_id" name="province_id">
            <option value="">--选择省份--</option>
            {foreach from = $province_list item =this}
            <option value="{$this.province_id}">{$this.province_name}</option>
            {/foreach}
        </select>
    </li>
    <li class="clearfix">
        <label class="fl">所在城市</label>
        <select id="city_id" name="city_id">
            <option value="">--选择城市--</option>
        </select>
    </li>
    <!-- <li class="clearfix">
        <label class="fl">所在地区</label>
        <select id="area_id" name="area_id">
            <option value="">--选择地区--</option>
        </select>
    </li> -->
</ul>

<h6 class="bei">投资信息</h6>
<ul class="visit_from" style="margin-top:0;">
	<li class="clearfix lingyu_spread" style="border-bottom:1px solid #ddd;">
        <label for="focus-lingyu" class="fl">关注领域</label>
        <!--<select name="field" id="focus-lingyu">
            <option value=''>请选择关注领域</option>
            {foreach from=$field_list item=v}
            <option value='{$v.type_id}'>{$v.type_name}</option>
            {/foreach}
        </select>-->
        <span id="focus-lingyu" class="multi_select fl">请选择关注领域</span>
        <input type="hidden" name="field" value="">
        <i class="fr icon icon_enter_default3x"></i>
    </li>
    <ul class="lingyu_list_wrap list_wrap">
    	{foreach from=$field_list item=v}
    	<li class="list">
    		<i class="pic icon_xuanze_default3x"></i>
    		<span data-val="{$v.type_id}">{$v.type_name}</span>
    	</li>
    	{/foreach}
    </ul>
    <li class="clearfix jieduan_spread" style="font-size:0.75rem;border-bottom:1px solid #ddd;">
        <label for="focus-jieduan" class="fl">关注阶段</label>
        <!--<select name="phase" id="focus-jieduan">
            <option value=''>请选择关注阶段</option>
            {foreach from=$phase_list item=v}
            <option value='{$v.type_id}'>{$v.type_name}</option>
            {/foreach}
        </select>-->
        <input type="hidden" name="phase" value="">
        <span id="focus-jieduan" class="multi_select fl">请选择关注阶段</span>
        <i class="fr icon icon_enter_default3x"></i>
    </li>
    <ul class="jieduan_list_wrap list_wrap">
    	{foreach from=$phase_list item=v}
    	<li class="list">
    		<i class="pic icon_xuanze_default3x"></i>
    		<span data-val="{$v.type_id}">{$v.type_name}</span>
    	</li>
    	{/foreach}
    </ul>
    <li class="clearfix">
        <label for="money-type" class="fl">主投币种</label>
        <select name="main_currency" id="money-type">
            <option value=''>请选择主投币种</option>
            {foreach from=$currency_list item=v}
            <option value='{$v.type_id}'>{$v.type_name}</option>
            {/foreach}
        </select>
        <i class="fr icon icon_enter_default3x"></i>
    </li>
</ul>
<div class="overseas">
	<ul class="clearfix">
		<li class="fl">有无海外投资资格</li>
		<li class="fr btn-choose" data-overseas='0'>
			<i class="pic icon_xuanze_selected3x"></i>
			<span>无</span>
		</li>
		<li class="fr btn-choose" style="margin-right:1.25rem;"  data-overseas='1'>
			<i class="pic icon_xuanze_default3x"></i>
			<span>有</span>
		</li>
	</ul>
    <input type="hidden" name='overseas'>
</div>

<h6 class="bei">个人简介</h6>
<textarea name="introduction" placeholder="请输入个人简介" class="bei_txt person-intro" style="box-sizing:border-box;"></textarea>
<h6 class="bei">机构信息</h6>
<textarea name="mechanism_desc" placeholder="请输入机构信息" class="bei_txt organize-intro" style="box-sizing:border-box;"></textarea>
</form>
<div class="submit_btn">申请认证</div>
{/block}
{block name="js"}
    <script src="__ACPJS__/AcpServiceProviders/linkage.js?version={$version}"></script>
	<script type="text/javascript" src="/Public/Js/front/front_js/ajaxupload.3.5.js"></script>
    <script type="text/javascript">
    var project_id = '{$project_id}';
    //分享的参数
    var share_pic = '/Public/Images/front/front_img/logo_default3x.png';
    var share_title = '银江孵化器';
    var desc_str = '投资人认证';
    var share_desc = desc_str.substr(0,30);
    var share_url = document.location.href;
{literal}
    	$(".overseas .btn-choose").on("click",function(){
    		$(this).find("i").removeClass("icon_xuanze_default3x").addClass("icon_xuanze_selected3x");
    		$(this).siblings(".btn-choose").find("i")
    		.removeClass("icon_xuanze_selected3x")
    		.addClass("icon_xuanze_default3x");
            $('input[name=overseas]').val($(this).data('overseas'));
    	});
    	
//    	$(".service_header i,.service_header span").on("click",function(){
//            history.go(-1);
//        });
    	$(".submit_btn").on("click",function(){
    		if($("#name_ren").val()==''){
                layer.open({
                    content: '请输入真实姓名',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }
    		if($("#tell").val()==''){
                layer.open({
                    content: '请输入联系电话',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }
    		if($("#organize").val()==''){
                layer.open({
                    content: '请输入所在机构',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }
    		if($("#job").val()==''){
                layer.open({
                    content: '请输入职位',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }
    		if($("#job").val()==''){
                layer.open({
                    content: '请输入职位',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }

            if($('#project_id').val() == ''){
                layer.open({
                    content: '请选择所在省份',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }

            if($('#city_id').val() == ''){
                layer.open({
                    content: '请选择所在城市',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }


    		if($(".person-intro").val()==''){
                layer.open({
                    content: '请输入个人简介',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }
    		if($(".organize-intro").val()==''){
                layer.open({
                    content: '请输入机构信息',
                    title: false,
                    btn: ['确定'],
                });
                return;
            }

            $.ajax({
                url:'/FrontEnjoy/check_investor',
                type:'post',
                data:$('#form1').serialize(),
                success:function(r){
                    if(r.code == 0){
                        layer.open({
                                content: r.msg,
                                title: false,
                                btn: ['确定'],
                                yes:function(){
                                    if (!is_wechat()) {
                                        native_listen('back');
                                    } else {
                                        history.go(-1);
                                    }
                                }
                            });
                        //location.href='/FrontEnjoy/project_details/project_id/'+project_id;
                        /*if(project_id != '' && project_id != 0 && project_id != null){
                            location.href='/FrontEnjoy/project_details/project_id/'+project_id;*/
                        }else{
                            layer.open({
                                content: r.msg,
                                title: false,
                                btn: ['确定'],
                            });
                        }
                        
                    }
                
            })
    	});

    	//关注领域
    	$(".lingyu_spread").on("click",function(){
    		$(this).find("i").toggleClass("icon_rotate");
    		$(".lingyu_list_wrap").toggle();
    	});
    	$(".lingyu_list_wrap .list").on("click",function(){
    		$(this).find("i").toggleClass("icon_xuanze_default3x")
    		.toggleClass("icon_xuanze_selected3x");

            var field = '';//领域
            $('.lingyu_list_wrap .list .icon_xuanze_selected3x').each(function () {
                $(this).siblings().data('val');
                field += $(this).siblings().data('val')+',';
            })
            field = field.substr(0, field.length - 1);
            console.log(field);

            $('input[name=field]').val(field);

    		if($(".lingyu_list_wrap .icon_xuanze_selected3x").length){
    			$("#focus-lingyu").css("color","#323232");
    			$("#focus-lingyu").html("已选择关注领域");
    		}else{
    			$("#focus-lingyu").css("color","#999");
    			$("#focus-lingyu").html("请选择关注领域");
    		}
    	});

    	//关注阶段
    	$(".jieduan_spread").on("click",function(){
    		$(this).find("i").toggleClass("icon_rotate");
    		$(".jieduan_list_wrap").toggle();
    	});
    	$(".jieduan_list_wrap .list").on("click",function(){
    		$(this).find("i").toggleClass("icon_xuanze_default3x")
    		.toggleClass("icon_xuanze_selected3x");
            var phase = '';//阶段
            $('.jieduan_list_wrap .list .icon_xuanze_selected3x').each(function () {
                $(this).siblings().data('val');
                phase += $(this).siblings().data('val')+',';
            })
            phase = phase.substr(0, phase.length - 1);
            console.log(phase);
            $('input[name=phase]').val(phase);



    		if($(".jieduan_list_wrap .icon_xuanze_selected3x").length){
    			$("#focus-jieduan").css("color","#323232");
    			$("#focus-jieduan").html("已选择关注阶段");
    		}else{
    			$("#focus-jieduan").css("color","#999");
    			$("#focus-jieduan").html("请选择关注阶段");
    		}
    	});
{/literal}    	
    </script>

{/block}
